package com.oc.mba.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.oc.mba.dao.DevicePaperDAO;
import com.oc.mba.dao.OcDevicesDAO;
import com.oc.mba.entity.OcDevicePaper;
import com.oc.mba.entity.OcDevices;
import com.oc.mba.service.DeviceService;

@Service
public class DeviceServiceImpl implements DeviceService {

	@Autowired
	private OcDevicesDAO devicesDAO;
	
	@Autowired
	private DevicePaperDAO devicePaperDAO;
	
	@Override
	public int presistDevice(String imei, String androidID) {
		return devicesDAO.presistDevice(imei, androidID);
	}

	@Override
	public OcDevices findById(int id) {
		return devicesDAO.findById(id);
	}

	@Override
	public OcDevices findByImei(String imei) {
		return devicesDAO.findByImei(imei);
	}

	@Override
	public OcDevices findByAndroidID(String androidID) {
		return devicesDAO.findByAndroidID(androidID);
	}

	@Override
	public List<OcDevicePaper> findDevicePapers(Integer deviceID) {
		return devicePaperDAO.findByDeviceID(deviceID);
	}

}
